﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace DAL
{
    public class DAL_AssetBorrowHeader : clsConnect
    {
        private clsConnect cls = new clsConnect();
        #region[Get-Data]
        public DataTable BindGirdAssetBorrowHeader()
        {
            return cls.GetData("sp_FAAssetBorrowHeader");
        }
        public DataTable BindGirdAssetBorrowHeader_Detail_Edit(int id)
        {
            return cls.GetData_Param_int("sp_FAAssetBorrowHeader_Detail_Edit", "@RowID", id);
        }
        #endregion

        #region[Autocomplete]
        public DataTable BindGirdAutoComplete()
        {
            return cls.GetData("sp_FAAssetBorrowHeader_AutoComplete");
        }
        #endregion

        #region[Search]
        public DataTable Search(string keywords)
        {
            return cls.Search("sp_FAAssetBorrowHeader_Search", "@KEYWORDS", keywords);
        }
        #endregion

        #region[Review]
        public bool Review(ET.AssetBorrowHeader data)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@RowID", data.RowID);
            cls.AddParameter("@Status", data.Status);
            cls.ExecuteNonQuery("sp_FAAssetBorrowHeader_Update");
            return true;
        }
        #endregion
    }
}
